import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class NaviUtil{

  static pushAndRemove(BuildContext context,Widget widget){
    Navigator.pushAndRemoveUntil(context,
        new MaterialPageRoute(builder: (BuildContext c) {
          return widget;
        }), (r) => r == null);

  }
  static pushAndRemoveUntil(BuildContext context,Widget widget){
    Navigator.pushAndRemoveUntil(
      context,
      new MaterialPageRoute(builder: (context) => widget),
          (route) => route == null,
    );;

  }

  static push(BuildContext context,Widget widget){
    Navigator.of(context).push(new MaterialPageRoute(builder: (con){
      return widget;
    }));
  }

  static pop(BuildContext context){
    Navigator.of(context).pop((){});

  }

}